package cn.edu.sdjzu.xg.bysj.domain;
import cn.edu.sdjzu.xg.bysj.security.Actor;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

public class User implements Comparable<User>, Serializable {
    private Integer id;
    private String username;
    private String password;
    private LocalDateTime loginTime;
    private Actor actor;


    public User(Integer id, String username, String password) {
        this.id = id;
        this.username = username;
        this.password = password;
    }

    public User(Integer id, String username, String password, Actor actor) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.actor = actor;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public LocalDateTime getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(LocalDateTime loginTime) {
        this.loginTime = loginTime;
    }

    public Actor getActor() {
        return actor;
    }

    public void setActor(Actor actor) {
        this.actor = actor;
    }

    @Override
    public int compareTo(User o) {
        // TODO Auto-generated method stub
        return this.id - o.id;
    }

}
